package com.example.myspringpro.exception;

import com.example.myspringpro.enums.ResultEnums;

/**
 * @Description 自定义异常类
 * @Author allenhu <huxiangneng@163.com>
 * @Date 2019/05/14
 * @Version V1.0.0
 **/
public class MyException extends RuntimeException{

    private String code;

    public MyException(String msg, String code) {
        super(msg);
        this.code = code;
    }

    public MyException(ResultEnums resultEnums) {
        super(resultEnums.getMsg());
        this.code = resultEnums.getCode();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

}
